﻿goog.provide('imc.ui.Cookie');

imc.ui.Cookie = function (opt) { //Constructor
    /*\\Behavior : --------------------------------- */
    this.opt = {
        username: c_name
        , idDivNav: "#izq"
        , idTableDataTable: "#tblDatosUsuarios"
    };
    $().extend(this.opt, opt);
    //alert(this.opt.test);
    this.getCookie();
    /*//Behavior : --------------------------------- */
} //Fin constructor

imc.ui.Cookie.prototype.getCookie = function () {
    var that = this;
    var i,x,y,ARRcookies=document.cookie.split(";");
    for (i=0;i<ARRcookies.length;i++)
    {
        x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
        y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
        x=x.replace(/^\s+|\s+$/g,"");
        if (x==this.opt.username)
        {
            return unescape(y);
        }
    }
};